package com.itheima.StudentView;

import java.util.Scanner;

public class StudentView {

    Scanner sc = new Scanner(System.in);

    Student[] students = new Student[50];

    int count = 0;

    Student[] newstudents = new Student[students.length-1];

    public void start(){
        while (true) {
            System.out.println("=====欢迎进入学生管理系统=====");
            System.out.println("1.添加学生");
            System.out.println("2.删除学生");
            System.out.println("3.修改学生");
            System.out.println("4.查看学生");
            System.out.println("5.退   出");
            System.out.println("请选择(1-5)：");
            int num = sc.nextInt();

            switch (num) {
                case 1://1.添加学生
                    addStudent();
                    break;
                case 2://2.删除学生
                    deleteStudent();
                    break;
                case 3://3.修改学生
                    updataStudent();
                    break;
                case 4://4.查看学生
                    findStudent();
                    break;
                case 5://5.退出
                    System.out.println("退出功能");
                    break;
            }
        }
    }

   private void addStudent( ){
        System.out.println("请您输入学生学号：");
        int id = sc.nextInt();
        System.out.println("请您输入学生姓名：");
        String name = sc.next();
        System.out.println("请您输入学生年龄：");
        int age = sc.nextInt();
        System.out.println("请您输入学生性别：");
        String sex = sc.next();

        Student student = new Student(id, name, age, sex);

        students[count] = student;
        count++;
       System.out.println("添加成功！！！");
    }

    private void deleteStudent(){

    }

    private void updataStudent(){

    }

    private void findStudent(){

    }

}
